
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>docker · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="git.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    starting
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../INTRODUCTION.html">
            
                <a href="../INTRODUCTION.html">
            
                    
                    introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    algorithm
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../algorithm/graphic_processing/">
            
                <a href="../algorithm/graphic_processing/">
            
                    
                    graphic_processing
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../algorithm/machine_learning/">
            
                <a href="../algorithm/machine_learning/">
            
                    
                    machine_learning
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../algorithm/other/">
            
                <a href="../algorithm/other/">
            
                    
                    other
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    language
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../language/cpp/">
            
                <a href="../language/cpp/">
            
                    
                    cpp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../language/golang/">
            
                <a href="../language/golang/">
            
                    
                    golang
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../language/java/">
            
                <a href="../language/java/">
            
                    
                    java
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../language/javascript/">
            
                <a href="../language/javascript/">
            
                    
                    javascript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../language/python/">
            
                <a href="../language/python/">
            
                    
                    python
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    soft_skills
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.5.1" data-path="docker.html">
            
                <a href="docker.html">
            
                    
                    docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="git.html">
            
                <a href="git.html">
            
                    
                    git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="ideaj.html">
            
                <a href="ideaj.html">
            
                    
                    ideaj
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="linux.html">
            
                <a href="linux.html">
            
                    
                    linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="maven.html">
            
                <a href="maven.html">
            
                    
                    maven
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="mysql.html">
            
                <a href="mysql.html">
            
                    
                    mysql
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="nginx.html">
            
                <a href="nginx.html">
            
                    
                    nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="node.js.html">
            
                <a href="node.js.html">
            
                    
                    node.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="oracle.html">
            
                <a href="oracle.html">
            
                    
                    oracle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="redis.html">
            
                <a href="redis.html">
            
                    
                    redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="script.html">
            
                <a href="script.html">
            
                    
                    script
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="skill.html">
            
                <a href="skill.html">
            
                    
                    skill
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="tcp-ip.html">
            
                <a href="tcp-ip.html">
            
                    
                    tcp-ip
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="ubuntu.html">
            
                <a href="ubuntu.html">
            
                    
                    ubuntu
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.15" data-path="vscode.html">
            
                <a href="vscode.html">
            
                    
                    vscode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.16" data-path="windows.html">
            
                <a href="windows.html">
            
                    
                    windows
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >docker</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x5B89;&#x88C5;">&#x5B89;&#x88C5;</h2>
<table>
<thead>
<tr>
<th>COMMENT</th>
<th>URL</th>
</tr>
</thead>
<tbody>
<tr>
<td>Docker &#x5B89;&#x88C5;&#x6587;&#x6863;</td>
<td><a href="https://docs.docker.com/install" target="_blank">https://docs.docker.com/install</a></td>
</tr>
<tr>
<td>Docker &#x5B89;&#x88C5;&#x5305;&#x4E0B;&#x8F7D;</td>
<td><a href="https://download.docker.com" target="_blank">https://download.docker.com</a></td>
</tr>
</tbody>
</table>
<p>Linux &#x4F7F;&#x7528;&#x5B98;&#x65B9;&#x63D0;&#x4F9B;&#x7684;&#x811A;&#x672C;&#x8FDB;&#x884C;&#x5B89;&#x88C5;</p>
<pre><code class="lang-sh">curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh --mirror Aliyun
</code></pre>
<p>&#x5728; Linux &#x4E0B; docker &#x547D;&#x4EE4;&#x53EA;&#x80FD;&#x88AB; root &#x6216; docker &#x7EC4;&#x7684;&#x7528;&#x6237;&#x4F7F;&#x7528;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x5C06;&#x5F53;&#x524D;&#x7528;&#x6237;&#x52A0;&#x5165; docker &#x7EC4;</p>
<pre><code class="lang-sh">sudo groupadd docker
sudo usermod <span class="hljs-_">-a</span>G docker <span class="hljs-variable">$USER</span>
</code></pre>
<p>&#x914D;&#x7F6E; <a href="https://cr.console.aliyun.com/cn-hangzhou/mirrors" target="_blank">&#x963F;&#x91CC;&#x4E91;&#x955C;&#x50CF;&#x52A0;&#x901F;&#x5668;</a>&#xFF08;&#x6DFB;&#x52A0; <code>/etc/docker/daemon.json</code>&#xFF09;&#xFF0C;&#x7136;&#x540E;&#x91CD;&#x542F;&#x670D;&#x52A1;&#xFF08;<code>systemctl restart docker</code>&#xFF09;</p>
<pre><code class="lang-json"><span class="hljs-comment">/* /etc/docker/daemon.json */</span>

{
    <span class="hljs-string">&quot;registry-mirrors&quot;</span>: [<span class="hljs-string">&quot;https://sinjik6j.mirror.aliyuncs.com&quot;</span>]
}
</code></pre>
<p>&#x4F7F;&#x7528; <code>docker run hello-world</code> &#x6D4B;&#x8BD5; docker &#x662F;&#x5426;&#x6B63;&#x5E38;</p>
<hr>
<h2 id="&#x57FA;&#x672C;&#x6982;&#x5FF5;">&#x57FA;&#x672C;&#x6982;&#x5FF5;</h2>
<table>
<thead>
<tr>
<th>Docker</th>
<th>Java</th>
</tr>
</thead>
<tbody>
<tr>
<td>Docker Registry</td>
<td>Maven &#x4ED3;&#x5E93;</td>
</tr>
<tr>
<td>&#x4ED3;&#x5E93; repository</td>
<td>Jar &#x5305;</td>
</tr>
<tr>
<td>&#x6807;&#x7B7E; tag</td>
<td>Jar &#x5305;&#x7684;&#x7248;&#x672C;</td>
</tr>
<tr>
<td>&#x955C;&#x50CF; image</td>
<td>&#x7C7B;</td>
</tr>
<tr>
<td>&#x5BB9;&#x5668; container</td>
<td>&#x5B9E;&#x4F8B;</td>
</tr>
</tbody>
</table>
<ul>
<li>&#x4ED3;&#x5E93;&#x4F7F;&#x7528;&#x4E24;&#x6BB5;&#x5F0F;&#x65B9;&#x5F0F;&#x6765;&#x8868;&#x793A;&#xFF08;<code>&lt;User&gt;/&lt;Project&gt;</code>&#xFF0C;User &#x9ED8;&#x8BA4;&#x662F; library&#xFF08;&#x5B98;&#x65B9;&#x955C;&#x50CF;&#xFF09;&#xFF09;</li>
<li>&#x955C;&#x50CF;&#x4F7F;&#x7528; <code>&lt;Repository&gt;:&lt;Tag&gt;</code> &#x6765;&#x8868;&#x793A;&#xFF08;Tag &#x9ED8;&#x8BA4;&#x4E3A; latest&#xFF09;</li>
</ul>
<h3 id="expample">Expample</h3>
<p>library/ubuntu &#x662F;&#x4E00;&#x4E2A;&#x4ED3;&#x5E93;&#xFF0C;ubuntu:1804 &#x662F;&#x4E00;&#x4E2A;&#x955C;&#x50CF;&#xFF08;&#x5176;&#x4E2D;&#x7684; 1804 &#x662F;&#x6807;&#x7B7E;&#xFF09;&#xFF0C;&#x4F7F;&#x7528;&#x8BE5;&#x955C;&#x50CF;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x591A;&#x4E2A;&#x5BB9;&#x5668;&#xFF0C;&#x4F46;&#x662F;&#x5BB9;&#x5668;&#x5728;&#x5173;&#x95ED;&#x65F6;&#x5176;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x90FD;&#x4F1A;&#x88AB;&#x6E05;&#x7A7A;</p>

                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="git.html" class="navigation navigation-next navigation-unique" aria-label="Next page: git">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"docker","level":"1.5.1","depth":2,"next":{"title":"git","level":"1.5.2","depth":2,"path":"soft_skills/git.md","ref":"soft_skills/git.md","articles":[]},"previous":{"title":"soft_skills","level":"1.5","depth":1,"ref":"","articles":[{"title":"docker","level":"1.5.1","depth":2,"path":"soft_skills/docker.md","ref":"soft_skills/docker.md","articles":[]},{"title":"git","level":"1.5.2","depth":2,"path":"soft_skills/git.md","ref":"soft_skills/git.md","articles":[]},{"title":"ideaj","level":"1.5.3","depth":2,"path":"soft_skills/ideaj.md","ref":"soft_skills/ideaj.md","articles":[]},{"title":"linux","level":"1.5.4","depth":2,"path":"soft_skills/linux.md","ref":"soft_skills/linux.md","articles":[]},{"title":"maven","level":"1.5.5","depth":2,"path":"soft_skills/maven.md","ref":"soft_skills/maven.md","articles":[]},{"title":"mysql","level":"1.5.6","depth":2,"path":"soft_skills/mysql.md","ref":"soft_skills/mysql.md","articles":[]},{"title":"nginx","level":"1.5.7","depth":2,"path":"soft_skills/nginx.md","ref":"soft_skills/nginx.md","articles":[]},{"title":"node.js","level":"1.5.8","depth":2,"path":"soft_skills/node.js.md","ref":"soft_skills/node.js.md","articles":[]},{"title":"oracle","level":"1.5.9","depth":2,"path":"soft_skills/oracle.md","ref":"soft_skills/oracle.md","articles":[]},{"title":"redis","level":"1.5.10","depth":2,"path":"soft_skills/redis.md","ref":"soft_skills/redis.md","articles":[]},{"title":"script","level":"1.5.11","depth":2,"path":"soft_skills/script.md","ref":"soft_skills/script.md","articles":[]},{"title":"skill","level":"1.5.12","depth":2,"path":"soft_skills/skill.md","ref":"soft_skills/skill.md","articles":[]},{"title":"tcp-ip","level":"1.5.13","depth":2,"path":"soft_skills/tcp-ip.md","ref":"soft_skills/tcp-ip.md","articles":[]},{"title":"ubuntu","level":"1.5.14","depth":2,"path":"soft_skills/ubuntu.md","ref":"soft_skills/ubuntu.md","articles":[]},{"title":"vscode","level":"1.5.15","depth":2,"path":"soft_skills/vscode.md","ref":"soft_skills/vscode.md","articles":[]},{"title":"windows","level":"1.5.16","depth":2,"path":"soft_skills/windows.md","ref":"soft_skills/windows.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["-search","-sharing","-lunr"],"pluginsConfig":{"highlight":{},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"soft_skills/docker.md","mtime":"2020-02-07T06:47:48.032Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-17T16:45:36.070Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

